<template>
	<view class="con">
		<navigator @click="nextTo(item.newsId)" url="" class="dynamic" v-for="(item,index) in newsInfo" :key="index">
			<view class="dynamic-img">
				<image :src="item.image" mode=""></image>
			</view>
			<view class="dynamic-con">
				<view class="dynamic-title">
					{{item.title}}
				</view>
				<view class="dynamic-down">
					{{item.content}}
				</view>
			</view>
		</navigator>
	</view>
</template>

<script>
	import {
		NewsSelectAll
	} from '../../../common/request.js'
	
	export default{
		data(){
			return {
				newsInfo:[]
			}
		},
		methods:{
			nextTo(newsId){
				// uni.navigateTo({
				// })
			}
		},
		mounted() {
			NewsSelectAll().then(res=>{
				this.newsInfo=res.data
				// this.newsInfo.push(res.data[0])
				// this.newsInfo.push(res.data[1])
				// this.newsInfo.push(res.data[2])
			})
		}
	}
</script>

<style scoped lang="scss">
	.con{
		.dynamic{
			display: flex;
			border-bottom: #ddd 3rpx solid;
			margin: 10rpx 20rpx 0rpx 20rpx;
			padding-bottom: 10rpx;
			background-color: white;
			// 右边图片
			.dynamic-img{
				flex: 2;
				width: 400rpx;
				image{
					border-radius: 15rpx;
					margin: 10rpx 20rpx;
					width: 250rpx;
					height: 180rpx;
				}
			}
			// 左边内容
			.dynamic-con{
				flex: 4;
				padding: 10rpx;
				.dynamic-title{
					font-size: 34rpx;
					font-weight: 600;
					// @include ellipsis-two
				}
				.dynamic-down{
					margin-top: 20rpx;
					font-size: 28rpx;
				}
			}
		}
	}
	
</style>
